package com.cd.learn.cdlearn.pattern.command;

import org.assertj.core.util.Lists;

import java.util.List;

/**
 * 发起命令者
 */
public class Water {

    private List<Command> commands = Lists.newArrayList();

    public List<Command> getCommands() {
        return commands;
    }

    public void setCommands(Command command) {
        commands.add(command);
    }

    public void orderUp(){
        for (Command command : commands) {
            command.execute();
        }
    }
}
